//
// Created by tang on 23-4-23.
//

#ifndef PIINFO_CLASS_HPP
#define PIINFO_CLASS_HPP

#include <memory>
#include "common/namespace.h"
#include "parser/cursor.hpp"
#include "types/field.hpp"
#include "types/method.hpp"
#include "types/type_info.hpp"

class meta_parser;

struct BaseClass {
    BaseClass(const Cursor& cursor);

    std::string name;
};

class Class: public TypeInfo {
    friend class Method;
    friend class Field;
    friend class meta_parser;
public:
    Class(const Cursor &cursor, const Namespace &current_ns);

    std::string full_qualified_name() const;

    std::string name();

    bool should_compile() const;

    bool should_compile_field() const;

    bool should_compile_method() const;

    template<typename T>
    using SharedPtrVector = std::vector<std::shared_ptr<T>>;

    bool accessible() const;

    SharedPtrVector<BaseClass> base_classes_;
private:
    std::string name_;
    std::string qualified_name_;
    std::string display_name_;

    SharedPtrVector<Field> fields_;
    SharedPtrVector<Method> methods_;
};

#endif  // PIINFO_CLASS_HPP
